<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<base href="<%=basePath%>">
		<title>修改信息</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		
		<script type="text/javascript" >  
		   function subForm(){
		   		var name = $("#name").val();
		   		if(checkIsNull(name)){
		   			alert("标题不能为空！");
		   			$("#name").focus();
		   			return false;
		   		}
		   		$("#newsForm").submit();
		   }
		</script>
	</head>
	<body>
<script  type="text/javascript" >
KindEditor.ready(function(K) {
    K.create('textarea[name="news.conter"]', {
	themeType: 'simple',
	resizeType: 1,
    uploadJson : '${ctx}/kindeditor/jsp/upload_json.jsp',
    fileManagerJson : '${ctx}/kindeditor/jsp/file_manager_json.jsp',
    allowFileManager : true,
    afterBlur: function(){this.sync();}
     });
});
</script>	
	<div id="body-wrapper">
		<div id="main-content">
			<div class="content-box">
				<!-- Start Content Box -->
				<div class="content-box-header">
					<h3 style="cursor: s-resize;">
						添加信息
					</h3>
					<div class="clear"></div>
				</div>
				<!-- End .content-box-header -->
				<div style="display: block;" class="content-box-content">
					<form method="post" id="newsForm" name="newsForm" action="${ctx}/pages/news/update.action?type=${type}" <c:if test="${type > 19}">enctype="multipart/form-data"</c:if>>

						<fieldset>
							<p>
								<label>
									标题
								</label>
								<input id="name" class="text-input small-input" name="news.name" value="${news.name}" type="text">
							</p>
							<c:if test="${type > 19}">
							<p>
								<label>
									显示图片
								</label>
								<img src="${ctx}/UserFiles/${news.images}" width="100" height="100" />
							</p>	
							</c:if>
							<c:if test="${type > 19}">
							<p>
								<label>
									图片
								</label>
								<input id=images class="text-input small-input"
									name="myFile" type="file" />
							</p>	
							</c:if>	
							<c:if test="${type > 9}">					
							<p>
								<label>
									排序
								</label>
								<input id="sort" class="text-input small-input"
									name="news.sort" value="${news.sort}" type="text"><span style="color:red">&nbsp;&nbsp;(请输入数字)</span>
							</p>
							</c:if>								
							<p>
								<label>
									内容
								</label>
								<textarea id="ke_demo" name="news.conter" rows="20" cols="100" style="width:99%;height:400px;visibility:hidden;">${news.conter}</textarea>

							</p>
							
							<p>
								<label>
									状态
								</label>
								<select class="small-input" name="news.status">
									<option  value="1">
										启用
									</option>
									<option value="0" <c:if test="${news.status==0}"> selected="selected" </c:if> >
										锁定
									</option>
								</select>
							</p>

							<p>
								<input class="button" value="提交" onclick="subForm();"  type="button">
                                <input value="${news.id}" name="news.id"  type="hidden">
                                <input value="${type}" name="news.type"  type="hidden">
								<input class="button" value="返回" onclick="history.back();"  type="button">
							</p>
						</fieldset>
						<div class="clear"></div>
						<!-- End .clear -->
					</form>
				</div>
			</div>
		</div>
		</div>
	</body>
</html>
